-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Let admins see post thread even when the author blocks them #1678
Conversation
@@ -22,25 +22,41 @@ import { | |||
getRepoRev, | |||
handleReadAfterWrite, | |||
} from '../util/read-after-write' | |||
import { authPassthru } from '../../../../../api/com/atproto/admin/util' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed a build error that might be related to this—is it possible there's one too many ../
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. no idea how this happened though since it was auto-imported by vscode lol.
// TODO: is this right? checking for requester and error type is safe enough? | ||
if ( | ||
err instanceof AppBskyFeedGetPostThread.NotFoundError && | ||
requester | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I believe that should be fine 👍 Maybe there's a way to split the two cases-up more rather than have the requester
checks sprinkled throughout. For example, maybe the case could be offloaded up front since it's relatively simple on its own:
const requester =
auth.credentials.type === 'access' ? auth.credentials.did : null
if (!requester) {
const res = await ctx.appviewAgent.api.app.bsky.feed.getPostThread(
params,
authPassthru(req),
)
return {
encoding: 'application/json',
body: res.data,
}
}
// ...
// rest of code continues as originally written
// ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, looks much better. just wasn't sure if the whole handleReadAfterWrite
is needed for mods too so didn't spend any time thinking about the implementation. cleaned it up as suggested, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…y-social#1678) * ✨ Let admins see post thread even when the author blocks them * ♻️ Refactor requester check
No description provided.